<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String root;
	
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>글 쓰기</title>
</head>
<script type="text/javascript">
function checkForm() {
	var form = document.writeForm;
	
	if(form.brdtitle.value == "") {
		alert("제목을 입력하세요.");
		form.brdtitle.focus();
		return false;	
	}

	if(form.brdcontent.value == "") {
		alert("내용을 입력하세요.");
		form.brdcontent.focus();
		return false;	
	}
	return true;
}
</script>
<body>
<center><h1>새글 작성</h1></center>
	<form action="write.do" method="post" name="writeForm" onsubmit="return checkForm()">
		<table border="1" width="640" align="center">
			<tr>
				<td>제목</td>
				<td><input type="text" id="brdtitle" name="brdtitle" style="width: 400px"/></td>
			</tr>
			<tr>
				<td>내용</td>
				<td><textarea id="btdcontent" name="brdcontent" rows="7" style="width: 95%"></textarea></td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input type="button" value="초기화"></input>					
					<input type="submit" value="작성"></input>
				</td>
			</tr>
		</table>
	
	</form>
</body>
</html>